﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using PureMVC.Interfaces;
using PureMVC.Patterns;
using SMS.Core.Model;
using SMS.Core.Model.Data;
using SMS.Core.View;

namespace SMS.Core.Controller.Commands
{
    class DisconnectCommand : SimpleCommand, ICommand
    {
        #region ICommand

        public new void Execute(INotification notification)
        {
            switch (notification.Name)
            {
                case ModelConstants.Connection.DISCONNECT:
                    ((PersistentConnectionProxy)Facade.
                        RetrieveProxy(PersistentConnectionProxy.NAME)).
                        CloseConnection();
                    break;
            }
        }

        #endregion
    }
}
